Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dynamically intern strings at runtime #76

Merged
merged 8 commits into from
Dec 27, 2023
Merged

dynamically intern strings at runtime #76

merged 8 commits into from
Dec 27, 2023

Conversation

y21
Copy link
Owner

@y21 y21 commented Dec 27, 2023

We've been interning (constant) strings in the frontend (pre-VM) for quite a while, but we always threw them away and turned them into Rc<str>s in the compiler. This PR changes it to keep strings interned all the way up until including the vm. It also dynamically interns strings and tries to recycle unused ones with a free list.

One of the big upsides here is that the Value enum is now effectively dropless, which will have a positive impact on e.g. returning from functions when the vm mass splices values off the stack (which can now just compile to decrementing the length).

It also brings us one step closer to a smaller Value type (hasn't changed it though)

@y21 y21 added the A-vm label Dec 27, 2023
@y21
Copy link
Owner Author

y21 commented Dec 27, 2023

This somehow didn't regress test262 but actually ended up making two more tests pass.

@y21 y21 merged commit 5f16bec into master Dec 27, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant